package com.infosys.cabplanningdao.address.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.infosys.cabplanning.common.domain.Address;

public class AddressRowMapper implements RowMapper<Address> {

	@Override
	public Address mapRow(ResultSet resultSet, int rowNum) throws SQLException {
		Address address = new Address();
		address.setAddressId(resultSet.getInt("address_id"));
		address.setHouseNo(resultSet.getInt("house_no"));
		address.setStreetName(resultSet.getString("street"));
		address.setCity(resultSet.getString("city"));
		address.setCountry(resultSet.getString("country"));
		address.setZipCode(resultSet.getString("zip_code"));
		return address;
	}

}
